//
//  Primer_Protocol_Demo2VC.swift
//  APSwift
//
//  Created by jianbo.pei on 2023/3/28.
//

import UIKit

/// 可选的协议
class Primer_Protocol_Demo2VC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        objc_writeDemo2()
    }

}


protocol Demo2Protocol {
    /// 可选协议
    func readDemo2()
    
    /// 必选协议
    func writeDemo2()
}

extension Demo2Protocol {
    func readDemo2() { }
}

extension Primer_Protocol_Demo2VC: Demo2Protocol {
    func writeDemo2() {
        
    }
}


@objc protocol Demo2_objc_Protocol {
    @objc optional func objc_readDemo2()
    @objc func objc_writeDemo2()
}

extension Primer_Protocol_Demo2VC: Demo2_objc_Protocol {
    func objc_writeDemo2() {
        print("走了Demo2_objc_Protocol的必选协议 objc_writeDemo2")
    }
}
